Source for file SC_PageNavi.php
Documentation is available at SC_PageNavi.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2011 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<input type="hidden" name="pageno" value="<!--{$tpl_pageno}-->">
$objPage->tpl_pageno = $_POST['pageno'];
・$func_nameに指定するJavaScriptの例
function fnNaviPage(pageno) {
document.form1['pageno'].value = pageno;
function SC_PageNavi($now_page, $all_row, $page_row, $func_name, $navi_max = NAVI_PMAX, $urlParam = '', $display_number = true) {
//現在ページ($now_page)が正しい数値でない場合
if (!preg_match("/^[[:digit:]]+$/", $now_page) || $now_page < 1 || strlen($now_page) == 0) {
// 最終ページよりも現在ページが大きい場合は、最初に戻す。
$this->all_row = $all_row;
$before = "<a href=\"?$urlParamThis\" onclick=\"$func_name('{$this->arrPagenavi['before']}'); return false;\"><<前へ</a> ";
$next = " <a href=\"?$urlParamThis\" onclick=\"$func_name('{$this->arrPagenavi['next']}'); return false;\">次へ>></a> ";
if ($navi_max == "" || $navi_max > $this->max_page) {
// 制限ナビ数の指定がない。ページ最大数が制限ナビ数より少ない。
$disp_max = $this->now_page + $navi_max - 1;
// ページ最大数を超えている場合は、ページ最大数に合わせる。
if ($navi_max == "" || $navi_max > $this->now_page) {
// 制限ナビ数の指定がない。現在ページ番号が制限ナビ数より少ない。
$disp_min = $this->now_page - $navi_max + 1;
for ($i= $disp_min; $i <= $disp_max; $i++ ) {
$page_number .= "<li><strong>$i</strong></li>";
$page_number .= "<li><a href=\"?$urlParamThis\" onclick=\"$func_name('$i'); return false;\">$i</a></li>";
$this->strnavi = $before . (($display_number) ? $page_number : ' | ') . $next;
} else if ($before || $next) {
$this->strnavi = $before . (($display_number) ? $page_number : '') . $next;
Documentation generated on Fri, 24 Feb 2012 14:02:52 +0900 by Seasoft
|